package cc.cc4414.cc02.system.converter;

import java.util.List;
import java.util.stream.Collectors;

import org.springframework.beans.BeanUtils;

import cc.cc4414.cc02.system.VO.UserVO;
import cc.cc4414.cc02.system.entity.User;

/**
 * @author cc 2018年5月1日
 */
public class User2UserVOConverter {
	public static UserVO convert(User user) {
		UserVO userVO = new UserVO();
		BeanUtils.copyProperties(user, userVO);
		return userVO;
	}

	public static List<UserVO> convert(List<User> users) {
		return users.stream().map(e -> convert(e)).collect(Collectors.toList());
	}
}
